


<?php


 $ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDTour";
 include_once("CBloqueoTable1.php");
 include_once("$ruta/MDTourGeneral/CDrawPageReg.php");
 include_once("$ruta/conf/CConfig.php");
 
if (!isset($_POST['multi'])) {$_POST['multi'] = "NULL"; }
if (!isset($_POST['from'])) {$_POST['from'] = "NULL"; }
if (!isset($_POST['to'])) {$_POST['to'] = "NULL"; }



$multiple = $_POST['multi'];
$from =  CDrawPageReg::getInstance()->amysql($_POST['from']);
$to = CDrawPageReg::getInstance()->amysql($_POST['to']);

$operadores="";
$i=0;

$campos = array(""=>"",""=>"");

foreach ($multiple as $r =>$c){
    $sql[]= "SELECT `pack`.`idPack` , concat_ws (' ',`operador`.`idOpe`,' ' ,  `operador`.`NamOpe`), `pack`.`OFICINAS_idOfi` , concat_ws(' ',`pack_has_tour`.`idPackTour`,' ',`pack_has_tour`.`NamTour`) ,
         `pack_has_tour`.`DateBegTour` , `pack_has_tour`.`DateEndTour` , `pack_has_tour`.`Status` , `pack_has_tour`.`PriTour` 
        FROM pack LEFT JOIN `viv`.`oficinas` ON `pack`.`OFICINAS_idOfi` = `oficinas`.`idOfi` 
        LEFT JOIN `viv`.`pack_has_tour` ON `pack`.`idPack` = `pack_has_tour`.`pack_idPack` 
        LEFT JOIN `viv`.`operador` ON `oficinas`.`OPERADOR_idOpe` = `operador`.`idOpe` 
        WHERE ((DateBegTour BETWEEN '$from' AND '$to' AND idOpe =$c AND DefaultTourPack=0)) ORDER BY DateBegTour DESC";
        
        $qu = "select NamOpe from operador where idOpe= $c";
        $ans = CModelo::getInstance()->getData($qu);
        foreach ($ans as $r => $k){ $ans2 = $k; foreach ($ans2 as $r1 => $k1 ){ $noms = $k1;}}
        
        CBloqueoTable1::getInstance()->DrawTable("Operador $noms ($c)",$sql[$i],$campos);
        $i = $i+1;
}

?>


